package com.yeung.dao.mapper;

import com.yeung.beans.Department;
import org.apache.ibatis.annotations.*;

//指定这是一个草所数据库的mapper
@Mapper
public interface DepartmentMapper {
    @Select("select * from department where id=#{id}")
    public Department getDepById(Integer id);

    @Delete("delete from department where id =#{id}")
    public int deleteDepById(Integer id);

    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("inser into department (departmentName) values(#{departmentName})")
    public int insertDept(Department department);

    @Update("update department set departmentName=#{departmentName} where id=#{id}")
    public int updateDept(Department department);
}
